#ifndef _SEMINTF_H_
#define _SEMINTF_H_

#include <stdio.h>
#include <sys/sem.h>  //添加信号量头文件
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>

#define EXTIO_SEM_KEY 2001
#define SENSOR_SEM_KEY 2002
#define SERVOJ_SEM_KEY 2003
#define PHYSICIO_SEM_KEY 2004
#define PNDEV_SEM_KEY 2005
#define EIP_SEM_KEY 2006
#define TORQUE_CONTROL_SEM_KEY 2007

typedef union semun
{
    int val;
    struct semid_ds* buf;
    unsigned short* array;
} semun;

extern int sem_get(key_t key);
extern int sem_p(int sem_id);
extern int sem_v(int sem_id);

#endif
